package com.bjb.vr.auth.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.bjb.vr.common.ao.OpenTenantAo;
import com.bjb.vr.common.dto.SysTenant;
import com.bjb.vr.common.mapper.SysTenantMapper;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @description:
 * @author: hujingbo
 * @create: 2022-12-09 18:01
 **/
@Service
public class AuthFeignService {

    @Resource
    private SysTenantMapper tenantMapper;

    /**
     * 查询租户信息
     *
     * @param openTenantAo
     * @return
     */
    public Object queryTenantInfo(OpenTenantAo openTenantAo) {
        LambdaQueryWrapper<SysTenant> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(StringUtils.isNotBlank(openTenantAo.getTenantId()), SysTenant::getTenantId, openTenantAo.getTenantId());
        return tenantMapper.selectOne(queryWrapper);
    }
}
